package game;
import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: dima
 * Date: 2/8/13
 * Time: 3:27 AM
 */
public class AutoPlayer implements PlayerItc{

    private StrategyIfc strategy;
    private double moneyAmount;
    private double betAmount;

    public AutoPlayer(StrategyIfc strategy, double initialMoney) {
        this.strategy = strategy;
        this.moneyAmount = initialMoney;
        this.betAmount = initialMoney / 10;
    }


    @Override
    public double getPlayerTotalMoney() {
        return moneyAmount;
    }

    @Override
    public char getNextMove(List<Card> playersCards, Card dealerCard, boolean playerHasOnlyTwoCards) {
        return strategy.getNextMove(playersCards, dealerCard, playerHasOnlyTwoCards);
    }

    @Override
    public double getBetAmount() {
        return betAmount;
    }

    @Override
    public void makeBet(double amount) {
        //todo: here is a duplication: the param. amount or the field betAmount?
        moneyAmount -= amount;
    }

    @Override
    public void addWinnings(double amount) {
        moneyAmount += amount;
    }
}
